@mixin make-rtl($class: '') {
  @include loop-grid-column-rtl($grid-columns, $class);
}

// mixin
@mixin loop-grid-column-rtl($index, $class) {
  @if ($index > 0) {
    .#{$prefix}-col#{$class}-push-#{$index} {
      // reset property in RTL direction
      &.#{$prefix}-col-rtl {
        right: percentage(($index / $grid-columns));
        left: auto;
      }
    }

    .#{$prefix}-col#{$class}-pull-#{$index} {
      // reset property in RTL direction
      &.#{$prefix}-col-rtl {
        right: auto;
        left: percentage(($index / $grid-columns));
      }
    }

    .#{$prefix}-col#{$class}-offset-#{$index} {
      // reset property in RTL direction
      &.#{$prefix}-col-rtl {
        margin-right: percentage(($index / $grid-columns));
        margin-left: 0;
      }
    }
  }

  @include loop-grid-column-lrt-0($index, $class);
}

@mixin loop-grid-column-lrt-0($index, $class) {
  @if ($index == 0) {
    .#{$prefix}-col-push-#{$index} {
      // reset property in RTL direction
      &.#{$prefix}-col-rtl {
        right: auto;
      }
    }

    .#{$prefix}-col-pull-#{$index} {
      &.#{$prefix}-col-rtl {
        left: auto;
      }
    }

    .#{$prefix}-col#{$class}-push-#{$index} {
      &.#{$prefix}-col-rtl {
        right: auto;
      }
    }

    .#{$prefix}-col#{$class}-pull-#{$index} {
      &.#{$prefix}-col-rtl {
        left: auto;
      }
    }

    .#{$prefix}-col#{$class}-offset-#{$index} {
      &.#{$prefix}-col-rtl {
        margin-right: 0;
      }
    }
  }
}

@if ($rtl) {
  .#{$prefix}-row {
    &-rtl {
      direction: rtl;
    }
  }
}
